package com.wanmait.employment.webController;


import com.wanmait.employment.entity.InterviewInvitation;
import com.wanmait.employment.service.InterviewInvitationService;
import com.wanmait.employment.util.AjaxResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("web/InterviewInvitation")
public class WebInterviewInvitationController {
    @Resource
    private InterviewInvitationService interviewInvitationService;

    @GetMapping("listFire")
    public AjaxResult listFire(Integer publisherId){
        List<InterviewInvitation> interviewInvitationList=interviewInvitationService.findList(publisherId);

        int limit = Math.min(interviewInvitationList.size(), 4); // 确定最终选取的元素数量
        interviewInvitationList = interviewInvitationList.subList(0, limit); // 截取前 limit 个元素

        return AjaxResult.success("success").put("interviewInvitationList",interviewInvitationList);

    }
}
